<?php $this->load->view('intro'); ?>
<body id="master_test_page">
<style type="text/css">
    html {
        background-color: white;
        width:100%;
    }
    body {
        background-color: white;
    }
    h1, h2, h3, h4, h5, h6 {
        color:#222;
    }
    ol li {
        color:#000;
        border-bottom:16px solid #fff;
        font-size:20px;
    }
    span.good {
        color:green;
    }

    span.bad{
        color:red;
    }

</style>
<h1>Master Unit Test Page</h1>
<div>
    <ol id="admin">
        <li><a href="index.php/unit_test/store_model_test">store model test</a>
            --------- <span id="store_model"></span></li>
        <li><a href="index.php/unit_test/validate_string_library_test">validation_string test</a>
            --------- <span id="validation_string"></span></li>
        <li><a href="index.php/unit_test/food_category_model_test">food category model test</a>
            --------- <span id="food_category_model"></span></li>
        <li><a href="index.php/unit_test/food_model_test">food model test</a>
            --------- <span id="food_model"></span></li>
        <li><a href="index.php/unit_test/food_option_category_model_test">food option category model test</a>
            --------- <span id="food_option_category_model"></span></li>
        <li><a href="index.php/unit_test/food_option_model_test">food option model test</a>
            --------- <span id="food_option_model"></span></li>
        <li><a href="index.php/unit_test/category_relation_test">category relation test</a>
            --------- <span id="category_relation_model"></span></li>
        <li><a href="index.php/unit_test/item_relation_test">item relation test</a>
            --------- <span id="item_relation_model"></span></li>
    </ol>
    <div style="height:3px; width: 100%; background-color: #cccccc;"></div>
    <ol id="order">
        <li><a href="index.php/unit_test/order_model_test">order model test</a>
        --------- <span id="order_model"></span></li>
    </ol>
</div>
<script type="text/javascript">
    $(document).ready(function(){
       // store model test
       $.ajax({
          url: 'index.php/unit_test/store_model_test',
          dataType:"json",
          success: function(data) {
            if(data.result === 'passed')
            {
                $("#store_model").html("Passed").addClass("good");
            }
            else
            {
                $("#store_model").html("Failed").addClass("bad");
            }
          }
        });
        // validation string test
        $.ajax({
          url: 'index.php/unit_test/validate_string_library_test',
          dataType:"json",
          success: function(data) {
            if(data.result === 'passed')
            {
                $("#validation_string").html("Passed").addClass("good");
            }
            else
            {
                $("#validation_string").html("Failed").addClass("bad");
            }
          }
        });
        // food category test
        $.ajax({
          url: 'index.php/unit_test/food_category_model_test',
          dataType:"json",
          success: function(data) {
            if(data.result === 'passed')
            {
                $("#food_category_model").html("Passed").addClass("good");
            }
            else
            {
                $("#food_category_model").html("Failed").addClass("bad");
            }
          }
        });

        // food model test
        $.ajax({
          url: 'index.php/unit_test/food_model_test',
          dataType:"json",
          success: function(data) {
            if(data.result === 'passed')
            {
                $("#food_model").html("Passed").addClass("good");
            }
            else
            {
                $("#food_model").html("Failed").addClass("bad");
            }
          }
        });

        // food option category test
        $.ajax({
          url: 'index.php/unit_test/food_option_category_model_test',
          dataType:"json",
          success: function(data) {
            if(data.result === 'passed')
            {
                $("#food_option_category_model").html("Passed").addClass("good");
            }
            else
            {
                $("#food_option_category_model").html("Failed").addClass("bad");
            }
          }
        });

        // food option test
        $.ajax({
          url: 'index.php/unit_test/food_option_model_test',
          dataType:"json",
          success: function(data) {
            if(data.result === 'passed')
            {
                $("#food_option_model").html("Passed").addClass("good");
            }
            else
            {
                $("#food_option_model").html("Failed").addClass("bad");
            }
          }
        });

        // category relation
        $.ajax({
          url: 'index.php/unit_test/category_relation_test',
          dataType:"json",
          success: function(data) {
            if(data.result === 'passed')
            {
                $("#category_relation_model").html("Passed").addClass("good");
            }
            else
            {
                $("#category_relation_model").html("Failed").addClass("bad");
            }
          }
        });

        // item relation
        $.ajax({
          url: 'index.php/unit_test/item_relation_test',
          dataType:"json",
          success: function(data) {
            if(data.result === 'passed')
            {
                $("#item_relation_model").html("Passed").addClass("good");
            }
            else
            {
                $("#item_relation_model").html("Failed").addClass("bad");
            }
          }
        });

        // order model
        $.ajax({
          url: 'index.php/unit_test/order_model_test',
          dataType:"json",
          success: function(data) {
            if(data.result === 'passed')
            {
                $("#order_model").html("Passed").addClass("good");
            }
            else
            {
                $("#order_model").html("Failed").addClass("bad");
            }
          }
        });

    });
</script>
<?php $this->load->view('outro'); ?>